@echo off
REM RESET installer label for Floppy Disk
REM This is DOS specific; do not use LFNs
REM
REM Change these variables per game need
REM
SET DSKLABEL=MEGAT 1
SET GAMENAME=MEGATRON
SET INSTALLR=SETUP.EXE
REM
REM START
CLS
IF NOT EXIST ASET.EXE GOTO FAIL1
ASET CDIR=DIR
ASET CPTH := COPY('%CDIR%',4,30)
ASET CDRV := COPY('%CDIR%',1,2)
ASET CLBL := LABEL
IF NOT EXIST Z:\COMMAND.COM GOTO REALDOS
MOUNT -u A:
MOUNT -u B:
MOUNT > MOUNT.TXT
ASET CDRIVE := DELETE(LINE(2,'MOUNT.TXT'),1,38)
MOUNT A %CDRIVE%\%CPTH%\%GAMENAME% -t floppy -label "%DSKLABEL%"
DEL MOUNT.TXT
IF NOT EXIST A:\%INSTALLR% GOTO FAIL2
CYCLES 3000
GOTO INSTALL
:REALDOS
LABEL %DSKLABEL%
IF NOT ERRORLEVEL 0 GOTO FAIL3
SUBST A: %GAMENAME%
:INSTALL
A:
%INSTALLR%
GOTO END
:FAIL1
ECHO !!!!          WARNING           !!!!
ECHO We need another program to run this!
ECHO ASET lets  us  set  some environment
ECHO variables to  uniquely label a DRIVE 
ECHO for the Installer to work.
GOTO END
:FAIL2
ECHO !!!!          WARNING           !!!!
ECHO The PATH for DOSBox may have long or
ECHO special character names. Please only
ECHO use short 8.3 as this is DOS anyway!
GOTO END
:FAIL3
ECHO !!!!          WARNING           !!!!
ECHO Unable to change the drive label for
ECHO the disk to what the installer needs
ECHO to work. Change label to %DSKLABEL%
ECHO and run installer manually.
:END
%CDRV%
IF EXIST Z:\COMMAND.COM GOTO EXIT
REM Clean up DOS changes
SUBST A: /D
IF NOT "%CLBL%" == "" LABEL %CLBL%
:EXIT